﻿<BaseUI:UserControlBase
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:BaseUI="clr-namespace:Silverlight.Weblog.Client.Default.Widgets.BaseUI"
	mc:Ignorable="d"
    VerticalAlignment="Top"
	xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
	xmlns:SampleData="clr-namespace:Expression.Blend.SampleData.NewCommentFormViewModelSampleData"
	xmlns:Commands="clr-namespace:Microsoft.Practices.Composite.Presentation.Commands;assembly=Microsoft.Practices.Composite.Presentation"
	 xmlns:common="clr-namespace:System.Windows;assembly=System.Windows.Controls" xmlns:System="clr-namespace:System;assembly=mscorlib"
	xmlns:SampleData1="clr-namespace:Expression.Blend.SampleData.CommentWidgetViewModel2"
	xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
	xmlns:Controls1="clr-namespace:Controls" xmlns:Behaviours="clr-namespace:Silverlight.Weblog.Client.DAL.Behaviours;assembly=Silverlight.Weblog.Client.DAL" x:Class="Silverlight.Weblog.Client.Default.Widgets.CommentWidget"
	d:DesignWidth="640" d:DesignHeight="5000" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">

    <!-- 
    make 2 changes to make this XAML blend friendly: 
    1) remove: Style="{StaticResource CommentExpanderStyle}"
    2) change <Setter Property="IsExpanded" Value="False"/> to <Setter Property="IsExpanded" Value="True"/>
    -->
	<BaseUI:UserControlBase.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="ExpanderResourceDictionary.xaml"/>
			</ResourceDictionary.MergedDictionaries>
			<SampleData1:CommentWidgetViewModel2 x:Key="CommentWidgetViewModel2" d:IsDataSource="True"/>
			<SampleData:NewCommentFormViewModelSampleData x:Key="NewCommentFormViewModelSampleData" d:IsDataSource="True"/>
			<Style x:Key="FormLabel" TargetType="TextBlock">
				<Setter Property="HorizontalAlignment" Value="Right"/>
				<Setter Property="VerticalAlignment" Value="Center"/>
				<Setter Property="FontSize" Value="18.667"/>
				<Setter Property="FontFamily" Value="Trebuchet MS"/>
				<Setter Property="FontStyle" Value="Italic"/>
			</Style>
			<DataTemplate x:Key="NewCommentDataTemplate">
				<Grid Height="306"  d:DataContext="{Binding Source={StaticResource NewCommentFormViewModelSampleData}}">
					<Grid.RowDefinitions>
						<RowDefinition Height="45"/>
						<RowDefinition Height="0.1*"/>
						<RowDefinition Height="0.1*"/>
						<RowDefinition Height="0.1*"/>
						<RowDefinition Height="0.45*"/>
						<RowDefinition Height="0.13*"/>
					</Grid.RowDefinitions>
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="167"/>
						<ColumnDefinition Width="193"/>
						<ColumnDefinition Width="*"/>
					</Grid.ColumnDefinitions>
					<TextBlock Grid.ColumnSpan="2" Text="Leave a Comment" TextWrapping="Wrap" Margin="18,4,0,0" FontFamily="Trebuchet MS" FontSize="24" FontWeight="Bold"/>
					<TextBlock Style="{StaticResource FormLabel}" Grid.Row="1" Text="Name:  " />
					<TextBox Behaviours:NavigationKeys.HandleNavigationKeyPresses="True"  FontFamily="Arial" FontSize="16" Grid.Column="1" Grid.Row="1" Text="{Binding Model.Name, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}" d:LayoutOverrides="Width" TabIndex="1" Margin="0,4,0,0"/>
					<TextBlock Style="{StaticResource FormLabel}" Grid.Row="2" Text="Email Address:  " Margin="0,6,0,0" VerticalAlignment="Top" />
					<TextBox Behaviours:NavigationKeys.HandleNavigationKeyPresses="True" FontFamily="Arial" FontSize="16" Grid.Column="1" Grid.Row="2" Text="{Binding Model.ClearEmailForNewComment, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}" Margin="0,4,0,1" d:LayoutOverrides="Width" TabIndex="2"/>
					<Controls1:Gravatar HorizontalAlignment="Left" Width="88" Grid.Column="2" Grid.RowSpan="3" Height="88"  Margin="27,5,0,6" Grid.Row="1" Email="{Binding Model.ClearEmailForNewComment, Mode=TwoWay}" />
					<TextBlock Style="{StaticResource FormLabel}" Grid.Row="4" Text="Comments:  " VerticalAlignment="Top" Height="26" d:LayoutOverrides="VerticalAlignment" />
					<TextBox Behaviours:NavigationKeys.HandleNavigationKeyPresses="True" Margin="0,3,8,0" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="4" Grid.RowSpan="1" Text="{Binding Model.HTML, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" TabIndex="4" FontFamily="Arial" FontSize="16" AcceptsReturn="True" MaxWidth="465" HorizontalContentAlignment="Stretch" HorizontalAlignment="Left" MinWidth="400"/>
					<Button Commands:Click.Command="{Binding AddComment}" Commands:Click.CommandParameter="{Binding Model}" Content="Submit" Grid.Row="5" Margin="107,8,73,8" FontSize="16" FontFamily="Trebuchet MS" TabIndex="5" Click="ButtonClickHack" Grid.Column="2" Width="100"/>
					<TextBlock Style="{StaticResource FormLabel}" Grid.Row="3" Text="URL:  " VerticalAlignment="Top" Margin="0,6,0,0" />
					<TextBlock FontSize="18.667" FontStyle="Italic" Foreground="#FF943131" TextWrapping="Wrap" Text="{Binding DisplayMessage}" Margin="18,8,-117,8" Grid.Row="5" Grid.ColumnSpan="2"/>
					<TextBox Behaviours:NavigationKeys.HandleNavigationKeyPresses="True" FontFamily="Arial" FontSize="16" Grid.Column="1" Grid.Row="3" Text="{Binding Model.Url, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}" Margin="0,4,0,1" d:LayoutOverrides="Width" TabIndex="3"/>
				</Grid>
			</DataTemplate>
			<ControlTemplate x:Key="ValidationToolTipTemplate">
				<Grid x:Name="Root" Margin="5,0" Opacity="0" RenderTransformOrigin="0,0">
					<Grid.RenderTransform>
						<TranslateTransform x:Name="xform" X="-25"/>
					</Grid.RenderTransform>
					<VisualStateManager.VisualStateGroups>
						<VisualStateGroup x:Name="OpenStates">
							<VisualStateGroup.Transitions>
								<VisualTransition GeneratedDuration="0"/>
								<VisualTransition GeneratedDuration="0:0:0.2" To="Open">
									<Storyboard>
										<DoubleAnimationUsingKeyFrames Storyboard.TargetName="xform" Storyboard.TargetProperty="X">
											<SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
										</DoubleAnimationUsingKeyFrames>
										<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
											<SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualTransition>
							</VisualStateGroup.Transitions>
							<VisualState x:Name="Closed">
								<Storyboard>
									<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
										<SplineDoubleKeyFrame KeyTime="0" Value="0"/>
									</DoubleAnimationUsingKeyFrames>
								</Storyboard>
							</VisualState>
							<VisualState x:Name="Open">
								<Storyboard>
									<DoubleAnimationUsingKeyFrames Storyboard.TargetName="xform" Storyboard.TargetProperty="X">
										<SplineDoubleKeyFrame KeyTime="0" Value="0"/>
									</DoubleAnimationUsingKeyFrames>
									<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
										<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
									</DoubleAnimationUsingKeyFrames>
								</Storyboard>
							</VisualState>
						</VisualStateGroup>
					</VisualStateManager.VisualStateGroups>
					<Border Margin="4,4,-4,-4" Background="#052A2E31" CornerRadius="5"/>
					<Border Margin="3,3,-3,-3" Background="#152A2E31" CornerRadius="4"/>
					<Border Margin="2,2,-2,-2" Background="#252A2E31" CornerRadius="3"/>
					<Border Margin="1,1,-1,-1" Background="#352A2E31" CornerRadius="2"/>
					<Border Background="#FFDC000C" CornerRadius="2"/>
					<Border CornerRadius="2">
						<TextBlock Margin="8,4,8,4" MaxWidth="250" UseLayoutRounding="false" Foreground="White" Text="{Binding (Validation.Errors)[0].ErrorContent}" TextWrapping="Wrap"/>
					</Border>
				</Grid>
			</ControlTemplate>
			<Style x:Key="ReadonlyTextBox" TargetType="TextBox">
				<Setter Property="BorderThickness" Value="1"/>
				<Setter Property="Background" Value="#FFFFFFFF"/>
				<Setter Property="Foreground" Value="#FF000000"/>
				<Setter Property="Padding" Value="2"/>
				<Setter Property="BorderBrush">
					<Setter.Value>
						<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
							<GradientStop Color="#FFA3AEB9" Offset="0"/>
							<GradientStop Color="#FF8399A9" Offset="0.375"/>
							<GradientStop Color="#FF718597" Offset="0.375"/>
							<GradientStop Color="#FF617584" Offset="1"/>
						</LinearGradientBrush>
					</Setter.Value>
				</Setter>
				<Setter Property="Template">
					<Setter.Value>
						<ControlTemplate TargetType="TextBox">
							<Grid x:Name="RootElement">
								<VisualStateManager.VisualStateGroups>
									<VisualStateGroup x:Name="CommonStates">
										<VisualState x:Name="Normal"/>
										<VisualState x:Name="MouseOver">
											<Storyboard>
												<ColorAnimationUsingKeyFrames Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
													<SplineColorKeyFrame KeyTime="0" Value="#FF99C1E2"/>
												</ColorAnimationUsingKeyFrames>
											</Storyboard>
										</VisualState>
										<VisualState x:Name="Disabled">
											<Storyboard>
												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
													<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
												</DoubleAnimationUsingKeyFrames>
											</Storyboard>
										</VisualState>
										<VisualState x:Name="ReadOnly"/>
									</VisualStateGroup>
									<VisualStateGroup x:Name="FocusStates">
										<VisualState x:Name="Focused"/>
										<VisualState x:Name="Unfocused">
											<Storyboard>
												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
													<SplineDoubleKeyFrame KeyTime="0" Value="0"/>
												</DoubleAnimationUsingKeyFrames>
											</Storyboard>
										</VisualState>
									</VisualStateGroup>
									<VisualStateGroup x:Name="ValidationStates">
										<VisualState x:Name="Valid"/>
										<VisualState x:Name="InvalidUnfocused">
											<Storyboard>
												<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
													<DiscreteObjectKeyFrame KeyTime="0">
														<DiscreteObjectKeyFrame.Value>
															<Visibility>Visible</Visibility>
														</DiscreteObjectKeyFrame.Value>
													</DiscreteObjectKeyFrame>
												</ObjectAnimationUsingKeyFrames>
											</Storyboard>
										</VisualState>
										<VisualState x:Name="InvalidFocused">
											<Storyboard>
												<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
													<DiscreteObjectKeyFrame KeyTime="0">
														<DiscreteObjectKeyFrame.Value>
															<Visibility>Visible</Visibility>
														</DiscreteObjectKeyFrame.Value>
													</DiscreteObjectKeyFrame>
												</ObjectAnimationUsingKeyFrames>
												<ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
													<DiscreteObjectKeyFrame KeyTime="0">
														<DiscreteObjectKeyFrame.Value>
															<System:Boolean>True</System:Boolean>
														</DiscreteObjectKeyFrame.Value>
													</DiscreteObjectKeyFrame>
												</ObjectAnimationUsingKeyFrames>
											</Storyboard>
										</VisualState>
									</VisualStateGroup>
								</VisualStateManager.VisualStateGroups>
								<Border x:Name="Border" Opacity="1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1">
									<Grid>
										<Border x:Name="ReadOnlyVisualElement" Opacity="0" Background="#5EC9C9C9"/>
										<Border x:Name="MouseOverBorder" BorderBrush="Transparent" BorderThickness="1">
											<ScrollViewer x:Name="ContentElement" BorderThickness="0" IsTabStop="False" Padding="{TemplateBinding Padding}"/>
										</Border>
									</Grid>
								</Border>
								<Border x:Name="DisabledVisualElement" IsHitTestVisible="False" Opacity="0" Background="#A5F7F7F7" BorderBrush="#A5F7F7F7" BorderThickness="{TemplateBinding BorderThickness}"/>
								<Border x:Name="FocusVisualElement" Margin="1" IsHitTestVisible="False" Opacity="0" BorderBrush="#FF6DBDD1" BorderThickness="{TemplateBinding BorderThickness}"/>
								<Border x:Name="ValidationErrorElement" Visibility="Collapsed" BorderBrush="#FFDB000C" BorderThickness="1" CornerRadius="1">
									<ToolTipService.ToolTip>
										<ToolTip x:Name="validationTooltip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ValidationToolTipTemplate}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
											<ToolTip.Triggers>
												<EventTrigger RoutedEvent="Canvas.Loaded">
													<BeginStoryboard>
														<Storyboard>
															<ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible">
																<DiscreteObjectKeyFrame KeyTime="0">
																	<DiscreteObjectKeyFrame.Value>
																		<System:Boolean>true</System:Boolean>
																	</DiscreteObjectKeyFrame.Value>
																</DiscreteObjectKeyFrame>
															</ObjectAnimationUsingKeyFrames>
														</Storyboard>
													</BeginStoryboard>
												</EventTrigger>
											</ToolTip.Triggers>
										</ToolTip>
									</ToolTipService.ToolTip>
									<Grid Height="12" HorizontalAlignment="Right" Margin="1,-4,-4,0" VerticalAlignment="Top" Width="12" Background="Transparent">
										<Path Fill="#FFDC000C" Margin="1,3,0,0" Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z"/>
										<Path Fill="#ffffff" Margin="1,3,0,0" Data="M 0,0 L2,0 L 8,6 L8,8"/>
									</Grid>
								</Border>
							</Grid>
						</ControlTemplate>
					</Setter.Value>
				</Setter>
			</Style>
	
			<common:HierarchicalDataTemplate x:Key="ChildViewModelCommentsItemTemplate" ItemsSource="{Binding ChildViewModelComments}">
				<Grid Margin="4">
					<Grid.RowDefinitions>
						<RowDefinition Height="*"/>
					</Grid.RowDefinitions>
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="90"/>
						<ColumnDefinition/>
					</Grid.ColumnDefinitions>
					<StackPanel Orientation="Vertical" Grid.Column="1" Grid.Row="0">
						<StackPanel>
							<StackPanel Orientation="Horizontal"  Height="21" VerticalAlignment="Top" Margin="5,0,0,0">
								<TextBlock Text="{Binding Model.Name}" Margin="0" HorizontalAlignment="Left" FontFamily="Trebuchet MS" FontSize="16" FontStyle="Italic" Padding="0,0,5,0" FontWeight="Bold"/>
								<TextBlock Text="on " TextWrapping="Wrap" FontFamily="Trebuchet MS" FontSize="16" FontStyle="Italic"/>
								<TextBlock Text="{Binding CreatedDisplayDate}" Margin="0" HorizontalAlignment="Left" FontFamily="Trebuchet MS" FontSize="16" FontStyle="Italic" Padding="0,0,5,0"/>
								<TextBlock Text="said: " TextWrapping="Wrap" FontFamily="Trebuchet MS" FontSize="16" FontStyle="Italic"/>
							</StackPanel>
							<HyperlinkButton Content="{Binding LinkUri}" FontFamily="Trebuchet MS" FontSize="16" TargetName="_blank" NavigateUri="{Binding LinkUri}" MaxWidth="500" HorizontalAlignment="Left" d:LayoutOverrides="Width"/>
						</StackPanel>
						<TextBox Margin="0,15,0,10" Grid.Column="1" Text="{Binding Model.HTML, Mode=TwoWay}" TextWrapping="Wrap" IsReadOnly="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" HorizontalAlignment="Left" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" MaxWidth="500" Background="{x:Null}" Style="{StaticResource ReadonlyTextBox}" BorderBrush="{x:Null}" AcceptsReturn="True"/>
						<controlsToolkit:Expander FontFamily="Trebuchet MS" FontSize="16" IsExpanded="{Binding IsExpanderOpened, Mode=TwoWay}" BorderThickness="0" Style="{StaticResource CommentExpanderStyle}">
							<controlsToolkit:Expander.Header>
								<ContentControl Content="Leave a Reply"  />
							</controlsToolkit:Expander.Header>
							<ContentControl ContentTemplate="{StaticResource NewCommentDataTemplate}" Content="{Binding NewChildComment}" Margin="-70,0,0,0" Padding="0,15" Width="640" HorizontalContentAlignment="Stretch"/>
						</controlsToolkit:Expander>
					</StackPanel>
					<Controls1:Gravatar Width="80" Height="80" EmailMD5Hash="{Binding Model.EmailMD5Hash, Mode=OneWay}" VerticalAlignment="Top" Margin="3,3,7,0" BorderThickness="0,0,5,0"/>
				</Grid>
			</common:HierarchicalDataTemplate>
			<ControlTemplate x:Key="CommonValidationToolTipTemplate" TargetType="ToolTip">
				<Grid x:Name="Root" Margin="5,0" Opacity="0" RenderTransformOrigin="0,0">
					<VisualStateManager.VisualStateGroups>
						<VisualStateGroup x:Name="OpenStates">
							<VisualStateGroup.Transitions>
								<VisualTransition GeneratedDuration="0"/>
								<VisualTransition GeneratedDuration="0:0:0.2" To="Open">
									<Storyboard>
										<DoubleAnimation Duration="0:0:0.2" Storyboard.TargetName="Translation" Storyboard.TargetProperty="X" To="0">
											<DoubleAnimation.EasingFunction>
												<BackEase Amplitude=".3" EasingMode="EaseOut"/>
											</DoubleAnimation.EasingFunction>
										</DoubleAnimation>
										<DoubleAnimation Duration="0:0:0.2" Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To="1"/>
									</Storyboard>
								</VisualTransition>
							</VisualStateGroup.Transitions>
							<VisualState x:Name="Closed">
								<Storyboard>
									<DoubleAnimation Duration="0" Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To="0"/>
								</Storyboard>
							</VisualState>
							<VisualState x:Name="Open">
								<Storyboard>
									<DoubleAnimation Duration="0" Storyboard.TargetName="Translation" Storyboard.TargetProperty="X" To="0"/>
									<DoubleAnimation Duration="0" Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To="1"/>
								</Storyboard>
							</VisualState>
						</VisualStateGroup>
					</VisualStateManager.VisualStateGroups>
					<Grid.RenderTransform>
						<TranslateTransform x:Name="Translation" X="-25"/>
					</Grid.RenderTransform>
					<Border Margin="4,4,-4,-4" Background="#052A2E31" CornerRadius="5"/>
					<Border Margin="3,3,-3,-3" Background="#152A2E31" CornerRadius="4"/>
					<Border Margin="2,2,-2,-2" Background="#252A2E31" CornerRadius="3"/>
					<Border Margin="1,1,-1,-1" Background="#352A2E31" CornerRadius="2"/>
					<Border Background="#FFDC000C" CornerRadius="2">
						<TextBlock Margin="8,4,8,4" MaxWidth="250" UseLayoutRounding="false" Foreground="#FFFFFFFF" Text="{Binding (Validation.Errors)[0].Exception.Message}" TextWrapping="Wrap"/>
					</Border>
				</Grid>
			</ControlTemplate>
			<Style x:Key="CommentTreeViewItem" TargetType="controls:TreeViewItem">
				<Setter Property="Padding" Value="3"/>
				<Setter Property="HorizontalContentAlignment" Value="Left"/>
				<Setter Property="VerticalContentAlignment" Value="Top"/>
				<Setter Property="Background" Value="Transparent"/>
				<Setter Property="BorderThickness" Value="1"/>
				<Setter Property="Cursor" Value="Arrow"/>
				<Setter Property="IsTabStop" Value="True"/>
				<Setter Property="TabNavigation" Value="Once"/>
				<Setter Property="Margin" Value="0 1 0 0"/>
				<Setter Property="Template">
					<Setter.Value>
						<ControlTemplate TargetType="controls:TreeViewItem">
							<Grid Background="{x:Null}">
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="*"/>
								</Grid.RowDefinitions>
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="25"/>
									<ColumnDefinition Width="Auto"/>
									<ColumnDefinition Width="*"/>
								</Grid.ColumnDefinitions>
								<VisualStateManager.VisualStateGroups>
									<VisualStateGroup x:Name="CommonStates">
										<VisualState x:Name="Normal"/>
										<VisualState x:Name="MouseOver"/>
										<VisualState x:Name="Pressed"/>
										<VisualState x:Name="Disabled"/>
									</VisualStateGroup>
									<VisualStateGroup x:Name="SelectionStates">
										<VisualState x:Name="Unselected"/>
										<VisualState x:Name="Selected"/>
										<VisualState x:Name="SelectedInactive"/>
									</VisualStateGroup>
									<VisualStateGroup x:Name="HasItemsStates">
										<VisualState x:Name="HasItems"/>
										<VisualState x:Name="NoItems">
											<Storyboard>
												<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="Visibility">
													<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
												</ObjectAnimationUsingKeyFrames>
											</Storyboard>
										</VisualState>
									</VisualStateGroup>
									<VisualStateGroup x:Name="ExpansionStates">
										<VisualState x:Name="Collapsed"/>
										<VisualState x:Name="Expanded">
											<Storyboard>
												<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ItemsHost" Storyboard.TargetProperty="Visibility">
													<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
												</ObjectAnimationUsingKeyFrames>
												<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="border" Storyboard.TargetProperty="(Border.Padding)">
													<DiscreteObjectKeyFrame KeyTime="00:00:00">
														<DiscreteObjectKeyFrame.Value>
															<Thickness>1</Thickness>
														</DiscreteObjectKeyFrame.Value>
													</DiscreteObjectKeyFrame>
												</ObjectAnimationUsingKeyFrames>
											</Storyboard>
										</VisualState>
									</VisualStateGroup>
									<VisualStateGroup x:Name="ValidationStates">
										<VisualState x:Name="Valid"/>
										<VisualState x:Name="InvalidUnfocused">
											<Storyboard>
												<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Validation" Storyboard.TargetProperty="Visibility">
													<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
												</ObjectAnimationUsingKeyFrames>
											</Storyboard>
										</VisualState>
										<VisualState x:Name="InvalidFocused">
											<Storyboard>
												<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Validation" Storyboard.TargetProperty="Visibility">
													<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
												</ObjectAnimationUsingKeyFrames>
												<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationToolTip" Storyboard.TargetProperty="IsOpen">
													<DiscreteObjectKeyFrame KeyTime="0">
														<DiscreteObjectKeyFrame.Value>
															<System:Boolean>True</System:Boolean>
														</DiscreteObjectKeyFrame.Value>
													</DiscreteObjectKeyFrame>
												</ObjectAnimationUsingKeyFrames>
											</Storyboard>
										</VisualState>
									</VisualStateGroup>
								</VisualStateManager.VisualStateGroups>
								<ToggleButton x:Name="ExpanderButton" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsTabStop="False" TabNavigation="Once">
									<ToggleButton.Template>
										<ControlTemplate TargetType="ToggleButton">
											<Grid x:Name="Root" Background="Transparent">
												<VisualStateManager.VisualStateGroups>
													<VisualStateGroup x:Name="CommonStates">
														<VisualState x:Name="Normal"/>
														<VisualState x:Name="MouseOver">
															<Storyboard>
																<ColorAnimation Duration="0" Storyboard.TargetName="UncheckedVisual" Storyboard.TargetProperty="(Path.Stroke).Color" To="#FF1BBBFA"/>
															</Storyboard>
														</VisualState>
														<VisualState x:Name="Disabled">
															<Storyboard>
																<DoubleAnimation Duration="0" Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To=".7"/>
															</Storyboard>
														</VisualState>
													</VisualStateGroup>
													<VisualStateGroup x:Name="CheckStates">
														<VisualState x:Name="Unchecked"/>
														<VisualState x:Name="Checked">
															<Storyboard>
																<DoubleAnimation Duration="0" Storyboard.TargetName="UncheckedVisual" Storyboard.TargetProperty="Opacity" To="0"/>
																<DoubleAnimation Duration="0" Storyboard.TargetName="CheckedVisual" Storyboard.TargetProperty="Opacity" To="1"/>
															</Storyboard>
														</VisualState>
													</VisualStateGroup>
												</VisualStateManager.VisualStateGroups>
												<Grid HorizontalAlignment="Right" Margin="0 2 5 2">
													<Path x:Name="UncheckedVisual" Fill="#FFFFFFFF" Stroke="#FF989898" StrokeLineJoin="Miter" StrokeThickness="1" Height="9" HorizontalAlignment="Right" VerticalAlignment="Center" Width="6" Data="M 0,0 L 0,9 L 5,4.5 Z">
														<Path.RenderTransform>
															<ScaleTransform ScaleX="1.5" ScaleY="1.5" />
														</Path.RenderTransform>
													</Path>
													<Path x:Name="CheckedVisual" Fill="#FFE6E7E9" StrokeLineJoin="Miter" Height="6" HorizontalAlignment="Center" VerticalAlignment="Center" Width="6" Opacity="0" Data="M 6,0 L 6,6 L 0,6 Z" Stroke="#FFCDC5BF">
														<Path.RenderTransform>
															<ScaleTransform ScaleX="1.5" ScaleY="1.5" />
														</Path.RenderTransform>
													</Path>
												</Grid>
											</Grid>
										</ControlTemplate>
									</ToggleButton.Template>
								</ToggleButton>
								<Button x:Name="Header" Cursor="{TemplateBinding Cursor}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Foreground="{TemplateBinding Foreground}" IsTabStop="False" TabNavigation="Once" ClickMode="Hover" Grid.Column="1">
									<Button.Template>
										<ControlTemplate TargetType="Button">
											<Grid Background="{TemplateBinding Background}">
												<VisualStateManager.VisualStateGroups>
													<VisualStateGroup x:Name="CommonStates">
														<VisualState x:Name="Normal"/>
														<VisualState x:Name="Pressed"/>
														<VisualState x:Name="Disabled">
															<Storyboard>
																<DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To=".55"/>
															</Storyboard>
														</VisualState>
													</VisualStateGroup>
												</VisualStateManager.VisualStateGroups>
												<ContentPresenter x:Name="Content" Cursor="{TemplateBinding Cursor}" HorizontalAlignment="Left" Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
											</Grid>
										</ControlTemplate>
									</Button.Template>
									<ContentPresenter Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}"/>
								</Button>
								<Border x:Name="Validation" Visibility="Collapsed" Grid.Column="1" BorderBrush="#FFDB000C" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2">
									<ToolTipService.ToolTip>
										<ToolTip x:Name="ValidationToolTip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" IsHitTestVisible="True" Template="{StaticResource CommonValidationToolTipTemplate}" Placement="Right" PlacementTarget="{Binding ElementName=Header}"/>
									</ToolTipService.ToolTip>
									<Grid Height="10" HorizontalAlignment="Right" Margin="0,-4,-4,0" VerticalAlignment="Top" Width="10" Background="Transparent">
										<Path Fill="#FFDC000C" Margin="-1,3,0,0" Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 Z"/>
										<Path Fill="#FFFFFFFF" Margin="-1,3,0,0" Data="M 0,0 L2,0 L 8,6 L8,8"/>
									</Grid>
								</Border>
								<ItemsPresenter x:Name="ItemsHost" Visibility="Collapsed" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1"/>
								<Border x:Name="border" Grid.Column="1" Grid.RowSpan="2" Grid.ColumnSpan="2" BorderBrush="#FFE6E7E9" BorderThickness="1" Margin="2,0" CornerRadius="2"/>
								<Border x:Name="border_Copy" Grid.Column="1" Grid.ColumnSpan="2" BorderBrush="#FFE6E7E9" BorderThickness="1" Margin="5,3" CornerRadius="2"/>
							</Grid>
						</ControlTemplate>
					</Setter.Value>
				</Setter>
				<Setter Property="IsExpanded" Value="True"/>
			</Style>
		</ResourceDictionary>
	</BaseUI:UserControlBase.Resources>
	<StackPanel x:Name="LayoutRoot" >
		<controls:TreeView ItemTemplate="{StaticResource ChildViewModelCommentsItemTemplate}" ItemsSource="{Binding ChildViewModelComments}" ItemContainerStyle="{StaticResource CommentTreeViewItem}" d:DataContext="{Binding Source={StaticResource CommentWidgetViewModel2}}" BorderThickness="0"/>
		<ContentControl ContentTemplate="{StaticResource NewCommentDataTemplate}" Content="{Binding NewParentlessComment}" Margin="0" Padding="0,0,0,20" HorizontalContentAlignment="Stretch"/>
	</StackPanel>
</BaseUI:UserControlBase>